master
parent
e9142f3dc7
commit
0ea6ed337a
Binary file not shown.
@ -0,0 +1,26 @@
|
||||
package com.example.hamburger;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.test.platform.app.InstrumentationRegistry;
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Instrumented test, which will execute on an Android device.
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class ExampleInstrumentedTest {
|
||||
@Test
|
||||
public void useAppContext() {
|
||||
// Context of the app under test.
|
||||
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
|
||||
assertEquals("com.example.hamburger", appContext.getPackageName());
|
||||
}
|
||||
}
|
@ -0,0 +1,84 @@
|
||||
package com.example.hamburger;
|
||||
import static androidx.test.core.app.ApplicationProvider.getApplicationContext;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.test.platform.app.InstrumentationRegistry;
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import com.example.hamburger.dao.UserDao;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.widget.EditText;
|
||||
import android.view.View;
|
||||
import android.widget.Toast;
|
||||
import android.widget.Button;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
import android.annotation.SuppressLint;
|
||||
import com.example.hamburger.dao.UserDao;
|
||||
import com.example.hamburger.entity.User;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class Mtest {
|
||||
|
||||
@Test
|
||||
public void text_1() {
|
||||
// Context of the app under test.
|
||||
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
|
||||
assertEquals("com.example.hamburger", appContext.getPackageName());
|
||||
|
||||
new Thread(){
|
||||
@Override
|
||||
public void run() {
|
||||
UserDao userDao = new UserDao();
|
||||
int msg = userDao.login("1","1");
|
||||
}
|
||||
}.start();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void text_2() {
|
||||
// Context of the app under test.
|
||||
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
|
||||
assertEquals("com.example.hamburger", appContext.getPackageName());
|
||||
|
||||
User user = new User();
|
||||
|
||||
user.setUserAccount("11");
|
||||
user.setUserPassword("11");
|
||||
user.setUserName("11");
|
||||
user.setUserType(1);
|
||||
user.setUserState(0);
|
||||
user.setUserDel(0);
|
||||
|
||||
new Thread(){
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
int msg = 0;
|
||||
|
||||
UserDao userDao = new UserDao();
|
||||
|
||||
User uu = userDao.findUser(user.getUserAccount());
|
||||
if(uu != null){
|
||||
msg = 1;
|
||||
}
|
||||
else{
|
||||
boolean flag = userDao.register(user);
|
||||
if(flag){
|
||||
msg = 2;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}.start();
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,70 @@
|
||||
package com.example.hamburger;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.widget.EditText;
|
||||
import android.view.View;
|
||||
import android.widget.Toast;
|
||||
import android.widget.Button;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
import android.annotation.SuppressLint;
|
||||
import com.example.hamburger.dao.UserDao;
|
||||
|
||||
public class MainActivity extends AppCompatActivity {
|
||||
|
||||
//这个类主要用来进行,账号密码的验证,以及监听事件的编写。
|
||||
// 所以首先需要将一开始设计的输入文本框id name 和passwd获取。
|
||||
EditText name;//创建账号
|
||||
EditText passwd;//创建密码
|
||||
|
||||
private static final String TAG="mysql-party-MainActivity";
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_main);
|
||||
|
||||
}
|
||||
|
||||
public void login(View view){
|
||||
|
||||
EditText EditTextAccount = findViewById(R.id.name);
|
||||
EditText EditTextPassword = findViewById(R.id.passwd);
|
||||
|
||||
Button button = (Button) findViewById(R.id.button);
|
||||
|
||||
new Thread(){
|
||||
@Override
|
||||
public void run() {
|
||||
UserDao userDao = new UserDao();
|
||||
int msg = userDao.login(EditTextAccount.getText().toString(),EditTextPassword.getText().toString());
|
||||
hand1.sendEmptyMessage(msg);
|
||||
}
|
||||
}.start();
|
||||
}
|
||||
|
||||
public void reg(View view){
|
||||
startActivity(new Intent(getApplicationContext(),register.class));
|
||||
}
|
||||
|
||||
@SuppressLint("HandlerLeak")
|
||||
final Handler hand1 = new Handler() {
|
||||
@Override
|
||||
public void handleMessage(Message msg) {
|
||||
if (msg.what == 0){
|
||||
Toast.makeText(getApplicationContext(), "登录失败", Toast.LENGTH_LONG).show();
|
||||
} else if (msg.what == 1) {
|
||||
Toast.makeText(getApplicationContext(), "登录成功", Toast.LENGTH_LONG).show();
|
||||
startActivity(new Intent(getApplicationContext(),MainActivity2.class));
|
||||
} else if (msg.what == 2){
|
||||
Toast.makeText(getApplicationContext(), "密码错误", Toast.LENGTH_LONG).show();
|
||||
} else if (msg.what == 3){
|
||||
Toast.makeText(getApplicationContext(), "账号不存在", Toast.LENGTH_LONG).show();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
package com.example.hamburger;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
import com.google.android.material.bottomnavigation.BottomNavigationView;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.navigation.NavController;
|
||||
import androidx.navigation.Navigation;
|
||||
import androidx.navigation.ui.AppBarConfiguration;
|
||||
import androidx.navigation.ui.NavigationUI;
|
||||
|
||||
import com.example.hamburger.databinding.ActivityMain2Binding;
|
||||
|
||||
public class MainActivity2 extends AppCompatActivity {
|
||||
|
||||
private ActivityMain2Binding binding;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
binding = ActivityMain2Binding.inflate(getLayoutInflater());
|
||||
setContentView(binding.getRoot());
|
||||
|
||||
BottomNavigationView navView = findViewById(R.id.nav_view);
|
||||
// Passing each menu ID as a set of Ids because each
|
||||
// menu should be considered as top level destinations.
|
||||
AppBarConfiguration appBarConfiguration = new AppBarConfiguration.Builder(
|
||||
R.id.navigation_home, R.id.navigation_dashboard, R.id.navigation_notifications)
|
||||
.build();
|
||||
NavController navController = Navigation.findNavController(this, R.id.nav_host_fragment_activity_main2);
|
||||
NavigationUI.setupActionBarWithNavController(this, navController, appBarConfiguration);
|
||||
NavigationUI.setupWithNavController(binding.navView, navController);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,72 @@
|
||||
package com.example.hamburger.entity;
|
||||
|
||||
public class IsolationUser {
|
||||
|
||||
private int id;
|
||||
private String name;
|
||||
private String gender;
|
||||
private String idnumber;
|
||||
private int roomnumber;
|
||||
private String checkin_time;
|
||||
|
||||
|
||||
public IsolationUser() {
|
||||
}
|
||||
|
||||
public IsolationUser(String name, String gender, String idnumber, int roomnumber, String checkin_time) {
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
this.gender = gender;
|
||||
this.idnumber = idnumber;
|
||||
this.roomnumber = roomnumber;
|
||||
this.checkin_time = checkin_time;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getname() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setname(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getGender() {
|
||||
return gender;
|
||||
}
|
||||
|
||||
public void setGender(String gender) {
|
||||
this.gender = gender;
|
||||
}
|
||||
|
||||
public String getIdnumber() {
|
||||
return idnumber;
|
||||
}
|
||||
|
||||
public void setIdnumber(String idnumber) {
|
||||
this.idnumber = idnumber;
|
||||
}
|
||||
|
||||
public int getRoomnumber() {
|
||||
return roomnumber;
|
||||
}
|
||||
|
||||
public void setRoomnumber(int roomnumber) {
|
||||
this.roomnumber = roomnumber;
|
||||
}
|
||||
|
||||
public String getCheckin_time() {
|
||||
return checkin_time;
|
||||
}
|
||||
|
||||
public void setCheckin_time(String checkin_time) {
|
||||
this.checkin_time = checkin_time;
|
||||
}
|
||||
}
|
@ -0,0 +1,83 @@
|
||||
package com.example.hamburger.entity;
|
||||
|
||||
public class User {
|
||||
|
||||
private int id;
|
||||
private String userAccount;
|
||||
private String userPassword;
|
||||
private String userName;
|
||||
private int userType;
|
||||
private int userState;
|
||||
private int userDel;
|
||||
|
||||
|
||||
public User() {
|
||||
}
|
||||
|
||||
public User(String userAccount, String userPassword) {
|
||||
this.id = id;
|
||||
this.userAccount = userAccount;
|
||||
this.userPassword = userPassword;
|
||||
this.userName = userName;
|
||||
this.userType = userType;
|
||||
this.userState = userState;
|
||||
this.userDel = userDel;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getUserAccount() {
|
||||
return userAccount;
|
||||
}
|
||||
|
||||
public void setUserAccount(String userAccount) {
|
||||
this.userAccount = userAccount;
|
||||
}
|
||||
|
||||
public String getUserPassword() {
|
||||
return userPassword;
|
||||
}
|
||||
|
||||
public void setUserPassword(String userPassword) {
|
||||
this.userPassword = userPassword;
|
||||
}
|
||||
|
||||
public String getUserName() {
|
||||
return userName;
|
||||
}
|
||||
|
||||
public void setUserName(String userName) {
|
||||
this.userName = userName;
|
||||
}
|
||||
|
||||
public int getUserType() {
|
||||
return userType;
|
||||
}
|
||||
|
||||
public void setUserType(int userType) {
|
||||
this.userType = userType;
|
||||
}
|
||||
|
||||
public int getUserState() {
|
||||
return userState;
|
||||
}
|
||||
|
||||
public void setUserState(int userState) {
|
||||
this.userState = userState;
|
||||
}
|
||||
|
||||
public int getUserDel() {
|
||||
return userDel;
|
||||
}
|
||||
|
||||
public void setUserDel(int userDel) {
|
||||
this.userDel = userDel;
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,101 @@
|
||||
package com.example.hamburger.ui.home;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
import android.view.View;
|
||||
import android.widget.EditText;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.example.hamburger.R;
|
||||
import com.example.hamburger.dao.UserDao;
|
||||
import com.example.hamburger.entity.IsolationUser;
|
||||
|
||||
public class Inform_input extends AppCompatActivity{
|
||||
|
||||
private static final String TAG = "mysql-party-register";
|
||||
EditText name = null;
|
||||
EditText gender = null;
|
||||
EditText idnumber = null;
|
||||
EditText roomnumber = null;
|
||||
EditText checkin_time = null;
|
||||
|
||||
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.infor_input);
|
||||
|
||||
name = findViewById(R.id.name);
|
||||
gender = findViewById(R.id.gender);
|
||||
idnumber = findViewById(R.id.ID_number);
|
||||
roomnumber = findViewById(R.id.roomnumber);
|
||||
checkin_time = findViewById(R.id.checkin_time);
|
||||
|
||||
}
|
||||
|
||||
public void addInfor(View view){
|
||||
String name1 = name.getText().toString();
|
||||
String gender1 = gender.getText().toString();
|
||||
String idnumber1 = idnumber.getText().toString();
|
||||
int roomnumber1 = Integer.parseInt(roomnumber.getText().toString());
|
||||
String checkin_time1 = checkin_time.getText().toString();
|
||||
|
||||
IsolationUser user=new IsolationUser();
|
||||
|
||||
user.setname(name1);
|
||||
user.setGender(gender1);
|
||||
user.setIdnumber(idnumber1);
|
||||
user.setRoomnumber(roomnumber1);
|
||||
user.setCheckin_time(checkin_time1);
|
||||
|
||||
new Thread(){
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
int msg = 0;
|
||||
|
||||
UserDao userDao = new UserDao();
|
||||
|
||||
IsolationUser uu = userDao.findUser_(user.getname());
|
||||
if(uu != null){
|
||||
msg = 1;
|
||||
}
|
||||
else{
|
||||
boolean flag = userDao.LogInfor(user);
|
||||
if(flag){
|
||||
msg = 2;
|
||||
}
|
||||
}
|
||||
hand.sendEmptyMessage(msg);
|
||||
|
||||
}
|
||||
}.start();
|
||||
}
|
||||
|
||||
@SuppressLint("HandlerLeak")
|
||||
final Handler hand = new Handler()
|
||||
{
|
||||
public void handleMessage(Message msg) {
|
||||
if(msg.what == 0) {
|
||||
Toast.makeText(getApplicationContext(),"录入失败",Toast.LENGTH_LONG).show();
|
||||
} else if(msg.what == 1) {
|
||||
Toast.makeText(getApplicationContext(),"该信息已经存在,请重新录入",Toast.LENGTH_LONG).show();
|
||||
} else if(msg.what == 2) {
|
||||
Toast.makeText(getApplicationContext(), "录入成功", Toast.LENGTH_LONG).show();
|
||||
Intent intent = new Intent();
|
||||
//将想要传递的数据用putExtra封装在intent中
|
||||
intent.putExtra("a","录入");
|
||||
setResult(RESULT_CANCELED,intent);
|
||||
finish();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
public void findInfor(View view){
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,140 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#c8c7c5"
|
||||
tools:context=".MainActivity">
|
||||
|
||||
<!--
|
||||
思路
|
||||
1.登录界面需要输入账号、密码,那么我们我要两个输入文本框。
|
||||
2.需要点击一个登录,那么需要一个登录按钮,以及监听按钮的登陆事件。
|
||||
3.作为一个简易的登录界面,我们并不加入数据库,添加一个账号密码识别认证即可。-->
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
tools:ignore="MissingConstraints"
|
||||
tools:layout_editor_absoluteX="-25dp"
|
||||
tools:layout_editor_absoluteY="291dp">
|
||||
|
||||
<!--android:layout_marginLeft 这个作用是设置和左边的间距
|
||||
android:layout_marginTop 这个作用是设置和顶部的间距
|
||||
android:ems 这个作用是限制输入长度
|
||||
android:hint 这个作用是设置输入文本框内的提示内容
|
||||
android:inputType 这个作用是选择输入的内容类型
|
||||
android:textColorHint 这个作用是设置文本框内提示内容的颜色-->
|
||||
|
||||
<!--android:onClick 这个作用是与java文件中的监听事件对应
|
||||
android:text 这个作用是给按钮一个文本显示-->
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="400dp"
|
||||
android:layout_height="100dp"
|
||||
android:text="隔离酒店智慧管理系统"
|
||||
android:textColor="#083684"
|
||||
android:gravity="center"
|
||||
android:textSize="30dp"
|
||||
>
|
||||
|
||||
</TextView>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/icon"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="100dp"
|
||||
android:background="@drawable/hotel_logo"
|
||||
app:layout_constraintTop_toBottomOf="@id/title"
|
||||
>
|
||||
|
||||
</ImageView>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/name"
|
||||
android:layout_width="264dp"
|
||||
android:layout_height="50dp"
|
||||
android:background="@color/white"
|
||||
android:ems="12"
|
||||
android:layout_marginTop="10dp"
|
||||
android:hint="输入用户名"
|
||||
android:inputType="text"
|
||||
android:textColorHint="#083684"
|
||||
tools:ignore="MissingConstraints"
|
||||
tools:layout_editor_absoluteX="75dp"
|
||||
tools:layout_editor_absoluteY="256dp"></EditText>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/passwd"
|
||||
android:layout_width="264dp"
|
||||
android:layout_height="50dp"
|
||||
android:background="@color/white"
|
||||
android:layout_marginTop="10dp"
|
||||
android:ems="12"
|
||||
android:hint="输入密码"
|
||||
android:inputType="textPassword"
|
||||
android:textColorHint="#083684"
|
||||
tools:ignore="MissingConstraints"
|
||||
tools:layout_editor_absoluteX="75dp"
|
||||
tools:layout_editor_absoluteY="360dp"></EditText>
|
||||
|
||||
<!-- <RadioGroup
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/radioButton"
|
||||
android:orientation="horizontal"
|
||||
android:layout_constraintTop_toBottomOf="@id/passwd">
|
||||
|
||||
<RadioButton
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/radioButton_1"
|
||||
android:text="隔离人员"
|
||||
android:textColor="#083684">
|
||||
|
||||
</RadioButton>
|
||||
|
||||
<RadioButton
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/radioButton_2"
|
||||
android:text="管理员"
|
||||
android:textColor="#083684">
|
||||
|
||||
</RadioButton>
|
||||
|
||||
</RadioGroup>-->
|
||||
|
||||
|
||||
|
||||
<Button
|
||||
android:id="@+id/button"
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="48dp"
|
||||
android:onClick="login"
|
||||
android:text="登录"
|
||||
android:layout_marginTop="10dp"
|
||||
android:backgroundTint="#083684"
|
||||
tools:ignore="MissingConstraints"
|
||||
tools:layout_editor_absoluteX="105dp"
|
||||
tools:layout_editor_absoluteY="469dp" />
|
||||
<!---->
|
||||
<Button
|
||||
android:id="@+id/register"
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="48dp"
|
||||
android:onClick="reg"
|
||||
android:text="注册"
|
||||
android:layout_marginTop="10dp"
|
||||
android:backgroundTint="#083684"
|
||||
tools:ignore="MissingConstraints"
|
||||
tools:layout_editor_absoluteX="105dp"
|
||||
tools:layout_editor_absoluteY="469dp" />
|
||||
</LinearLayout>
|
||||
<!---->
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
@ -0,0 +1,96 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:background="#c8c7c5"
|
||||
tools:context=".register">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
tools:ignore="MissingConstraints"
|
||||
tools:layout_editor_absoluteX="-25dp"
|
||||
tools:layout_editor_absoluteY="291dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="400dp"
|
||||
android:layout_height="100dp"
|
||||
android:text="酒店智慧管理系统"
|
||||
android:textColor="#083684"
|
||||
android:gravity="center"
|
||||
android:textSize="30dp">
|
||||
|
||||
</TextView>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/userAccount"
|
||||
android:layout_width="264dp"
|
||||
android:layout_height="50dp"
|
||||
android:background="@color/white"
|
||||
android:ems="12"
|
||||
android:layout_marginTop="10dp"
|
||||
android:hint="创建用户名"
|
||||
android:inputType="text"
|
||||
android:textColorHint="#083684"
|
||||
tools:ignore="MissingConstraints"
|
||||
tools:layout_editor_absoluteX="75dp"
|
||||
tools:layout_editor_absoluteY="256dp"></EditText>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/userName"
|
||||
android:layout_width="264dp"
|
||||
android:layout_height="50dp"
|
||||
android:background="@color/white"
|
||||
android:layout_marginTop="10dp"
|
||||
android:ems="12"
|
||||
android:hint="创建昵称"
|
||||
android:inputType="text"
|
||||
android:textColorHint="#083684"
|
||||
tools:ignore="MissingConstraints"
|
||||
tools:layout_editor_absoluteX="75dp"
|
||||
tools:layout_editor_absoluteY="360dp"></EditText>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/userPassword"
|
||||
android:layout_width="264dp"
|
||||
android:layout_height="50dp"
|
||||
android:background="@color/white"
|
||||
android:layout_marginTop="10dp"
|
||||
android:ems="12"
|
||||
android:hint="创建密码"
|
||||
android:inputType="textPassword"
|
||||
android:textColorHint="#083684"
|
||||
tools:ignore="MissingConstraints"
|
||||
tools:layout_editor_absoluteX="75dp"
|
||||
tools:layout_editor_absoluteY="360dp"></EditText>
|
||||
|
||||
<Button
|
||||
android:id="@+id/register"
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="48dp"
|
||||
android:onClick="register"
|
||||
android:text="注册"
|
||||
android:layout_marginTop="10dp"
|
||||
android:backgroundTint="#083684"
|
||||
tools:ignore="MissingConstraints"
|
||||
tools:layout_editor_absoluteX="105dp"
|
||||
tools:layout_editor_absoluteY="469dp" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/ret"
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="48dp"
|
||||
android:onClick="Ret"
|
||||
android:text="返回"
|
||||
android:layout_marginTop="10dp"
|
||||
android:backgroundTint="#083684"
|
||||
tools:ignore="MissingConstraints"
|
||||
tools:layout_editor_absoluteX="105dp"
|
||||
tools:layout_editor_absoluteY="469dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
@ -0,0 +1,177 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:background="#c8c7c5"
|
||||
tools:context=".ui.home.Inform_input">
|
||||
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
tools:layout_editor_absoluteX="219dp"
|
||||
tools:layout_editor_absoluteY="207dp"
|
||||
android:padding="50dp"
|
||||
|
||||
>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:textSize="15sp"
|
||||
android:text="姓名:" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:ems="10"
|
||||
android:inputType="text"
|
||||
/>
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:textSize="15sp"
|
||||
android:text="性别:" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/gender"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:ems="10"
|
||||
android:inputType="textPersonName"
|
||||
/>
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:textSize="15sp"
|
||||
android:text="身份证号:"
|
||||
|
||||
/>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/ID_number"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:ems="10"
|
||||
android:inputType="text"
|
||||
tools:ignore="DuplicateIds" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView3"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:textSize="15sp"
|
||||
android:text="房间号:"
|
||||
|
||||
/>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/roomnumber"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:ems="10"
|
||||
android:inputType="text"
|
||||
/>
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView4"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:textSize="15sp"
|
||||
android:text="入住时间:"
|
||||
|
||||
/>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/checkin_time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:ems="10"
|
||||
android:inputType="text"
|
||||
/>
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<Button
|
||||
android:layout_marginTop="50dp"
|
||||
android:id="@+id/button2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="录入"
|
||||
android:backgroundTint="#083684"
|
||||
android:onClick="addInfor"
|
||||
/>
|
||||
|
||||
<Button
|
||||
android:layout_marginTop="10dp"
|
||||
android:id="@+id/button3"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="查询"
|
||||
android:backgroundTint="#083684"
|
||||
android:onClick="findInfor"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_response"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textStyle="bold" />
|
||||
</LinearLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
Loading…
Reference in new issue